home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group98c.txt / 000145_icon-group-sender _Thu Dec 17 16:32:31 1998.msg < prev    next >
Internet Message Format  |  2000-09-20  |  930b

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA26327
  4.     for icon-group-addresses; Thu, 17 Dec 1998 16:32:25 -0700 (MST)
  5. Message-Id: <199812172332.QAA26327@baskerville.CS.Arizona.EDU>
  6. Date: Thu, 17 Dec 1998 14:43:06 -0800
  7. From: kwalker@sfo.harbinger.com (Ken Walker)
  8. To: icon-group@optima.CS.Arizona.EDU
  9. Subject: Re: Small Icon programming problem
  10. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  11. Status: RO
  12.  
  13. Okay, here is a slighty more obscure solution to the digit sorting
  14. problem (the lack of comments helps make it seem even more obscure
  15. than it is).
  16.  
  17. Ken Walker, kenneth.walker@sfo.harbinger.com
  18. Harbinger Coporation, Concord, Ca. 94520
  19.  
  20.  
  21. procedure disort(i)
  22.    local sortedInt, c
  23.  
  24.    sortedInt := ""
  25.    every c := !"-123456789" do
  26.       i ? while sortedInt ||:= (tab(upto(c)), tab(many(c)))
  27.  
  28.    return integer(sortedInt)
  29. end
  30.